﻿
#include <string.h>
#include "CXXLOBJECT.HPP"
#include <Sys\RenderUnit\SYSDDCLASSID.HPP>
#include <Sys\RenderUnit\SysDatagramDisposal_OpenGL\VERTEXREGISTRYDDOPENGL.HPP>
#include <Sys\RenderUnit\SysDatagramDisposal_OpenGL\STAGEDDPENGL.HPP>
#include <Sys\RenderUnit\SysDatagramDisposal_OpenGL\POSTDRAWDDOPENGL.HPP>

using namespace CxxlMan;

cxxlObject *cxxlFASTCALL New_CTestDDOpenGL();
cxxlObject *cxxlFASTCALL New_CVertexDD_NC_OpenGL();
cxxlObject *cxxlFASTCALL New_CVertexDD_NT_OpenGL();
cxxlObject *cxxlFASTCALL New_CVertexDD_T_OpenGL();
cxxlObject *cxxlFASTCALL New_CVertexDD_C_OpenGL();
cxxlObject *cxxlFASTCALL New_CVertexDD_N_OpenGL();
cxxlObject *cxxlFASTCALL New_CTrianglesStripDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CTrianglesListDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CSolidDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CLightAttribDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CControlAttribDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CGroupDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CAnchorDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CLightSourceMgrDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CTextureDD_2D_OpenGL();
cxxlObject *cxxlFASTCALL New_CMutiTextureDD_OpenGL();
cxxlObject *cxxlFASTCALL New_CCubemapTextureRD_OpenGL();
cxxlObject *cxxlFASTCALL New_CVertexRegistryDDOpenGL();
cxxlObject *cxxlFASTCALL New_CStageDDOpenGL();
cxxlObject *cxxlFASTCALL New_CPostDrawDDOpenGL();

extern "C" CXXL_DLLEXPORT
cxxlObject * cxxlCDECL CxxlMan_ObjectFactory(const wchar_t *ClassID, void *Arg, ISpirit *spirit)
{
  if(wcscmp(ITest_ClassID, ClassID) == 0)  
    return New_CTestDDOpenGL();

  if(wcscmp(ITextureRD_2D_ClassID, ClassID) == 0)  
    return New_CTextureDD_2D_OpenGL();

  if(wcscmp(IMutiTextureRD_ClassID, ClassID) == 0)  
    return New_CMutiTextureDD_OpenGL();

  if(wcscmp(ICubemapTextureRD_ClassID, ClassID) == 0)  
    return New_CCubemapTextureRD_OpenGL();

  else if(wcscmp(IVertex_NC_ClassID, ClassID) == 0)  
    return New_CVertexDD_NC_OpenGL();

  else if(wcscmp(IVertex_NT_ClassID, ClassID) == 0)  
    return New_CVertexDD_NT_OpenGL();

  else if(wcscmp(IVertex_T_ClassID, ClassID) == 0)  
    return New_CVertexDD_T_OpenGL();

  else if(wcscmp(IVertex_C_ClassID, ClassID) == 0)  
    return New_CVertexDD_C_OpenGL();

  else if(wcscmp(IVertex_N_ClassID, ClassID) == 0)  
    return New_CVertexDD_N_OpenGL();

  else if(wcscmp(ITrianglesStrip_ClassID, ClassID) == 0)  
    return New_CTrianglesStripDD_OpenGL();

  else if(wcscmp(ITrianglesList_ClassID, ClassID) == 0)  
    return New_CTrianglesListDD_OpenGL();

  else if(wcscmp(ILightAttrib_ClassID, ClassID) == 0)  
    return New_CLightAttribDD_OpenGL();

  else if(wcscmp(IControlAttrib_ClassID, ClassID) == 0)  
    return New_CControlAttribDD_OpenGL();

  else if(wcscmp(ISolid_ClassID, ClassID) == 0)  
    return New_CSolidDD_OpenGL();

  else if(wcscmp(IGroup_ClassID, ClassID) == 0)  
    return New_CGroupDD_OpenGL();

  else if(wcscmp(IAnchor_ClassID, ClassID) == 0)  
    return New_CAnchorDD_OpenGL();

  else if(wcscmp(ILightSourceMgr_ClassID, ClassID) == 0)  
    return New_CLightSourceMgrDD_OpenGL();

  else if(wcscmp(IVertexRegistryOpenGL_ClassID, ClassID) == 0) 
    return New_CVertexRegistryDDOpenGL();

  else if(wcscmp(IStageOpenGL_ClassID, ClassID) == 0) 
    return New_CStageDDOpenGL();

  else if(wcscmp(IPostDrawDDOpenGL_ClassID, ClassID) == 0) 
    return New_CPostDrawDDOpenGL();

  return NULL;
}

